/* 预约管理页面样式 */

/* 操作栏 */
.appointments-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.search-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.filter-group label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

/* 日历视图 */
.appointments-calendar-view {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.calendar-header h2 {
    margin: 0 1rem;
    font-size: 1.25rem;
    flex-grow: 1;
}

.view-toggle {
    display: flex;
    border-radius: 0.25rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.view-btn {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.view-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.view-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.calendar-container {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    min-height: 600px;
}

.calendar-time-column {
    border-right: 1px solid var(--border-color);
}

.time-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
}

.time-slots {
    display: flex;
    flex-direction: column;
}

.time-slot {
    height: 60px;
    padding: 0.25rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color-light);
}

.calendar-day {
    border-right: 1px solid var(--border-color);
}

.calendar-day:last-child {
    border-right: none;
}

.day-header {
    height: 60px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.day-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.day-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.day-slots {
    display: flex;
    flex-direction: column;
}

.appointment-slot {
    height: 60px;
    padding: 0.25rem;
    border-bottom: 1px solid var(--border-color-light);
    position: relative;
}

.appointment-item {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.appointment-item:hover {
    transform: scale(1.02);
}

.appointment-item.confirmed {
    background-color: rgba(var(--success-rgb), 0.15);
    border-left: 4px solid var(--success-color);
}

.appointment-item.pending {
    background-color: rgba(var(--warning-rgb), 0.15);
    border-left: 4px solid var(--warning-color);
}

.appointment-item.completed {
    background-color: rgba(var(--info-rgb), 0.15);
    border-left: 4px solid var(--info-color);
}

.appointment-item.canceled {
    background-color: rgba(var(--danger-rgb), 0.15);
    border-left: 4px solid var(--danger-color);
    text-decoration: line-through;
    opacity: 0.7;
}

.appointment-time {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.appointment-patient {
    font-weight: 500;
}

.appointment-type {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 列表视图 */
.appointments-list-view {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.appointments-table {
    width: 100%;
    border-collapse: collapse;
}

.appointments-table th,
.appointments-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color-light);
}

.appointments-table th {
    background-color: var(--bg-light);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
}

.appointments-table tr:hover {
    background-color: var(--hover-bg);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.confirmed {
    background-color: rgba(var(--success-rgb), 0.15);
    color: var(--success-color);
}

.status-badge.pending {
    background-color: rgba(var(--warning-rgb), 0.15);
    color: var(--warning-color);
}

.status-badge.completed {
    background-color: rgba(var(--info-rgb), 0.15);
    color: var(--info-color);
}

.status-badge.canceled {
    background-color: rgba(var(--danger-rgb), 0.15);
    color: var(--danger-color);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    color: var(--text-color);
    opacity: 0.7;
    transition: opacity 0.2s, background-color 0.2s;
}

.btn-icon:hover {
    opacity: 1;
    background-color: var(--hover-bg);
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-view {
    color: var(--info-color);
}

.btn-edit {
    color: var(--warning-color);
}

.btn-cancel {
    color: var(--danger-color);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color-light);
}

.page-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    align-items: center;
    margin: 0 0.5rem;
}

.page-number {
    background: none;
    border: none;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.1rem;
    transition: all 0.2s;
}

.page-number.active {
    background-color: var(--primary-color);
    color: white;
}

.page-number:hover:not(.active) {
    background-color: var(--hover-bg);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    width: 100%;
    max-width: 600px;
    animation: modalFadeIn 0.3s;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8f9fa;
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--danger-color);
    background-color: rgba(var(--danger-rgb), 0.1);
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    background-color: white;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fa;
    border-radius: 0 0 0.5rem 0.5rem;
}

.form-row {
    display: flex;
    margin: 0 -0.5rem;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 1.25rem;
    padding: 0 0.5rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.col-6 {
    width: 50%;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.form-control:hover:not(:focus) {
    border-color: #b0b0b0;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* 按钮样式增强 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 100px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.2);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background-color: #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .calendar-container {
        grid-template-columns: 60px repeat(7, 1fr);
    }
}

@media (max-width: 992px) {
    .appointments-action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: flex-end;
    }
    
    .calendar-container {
        grid-template-columns: 50px repeat(3, 1fr);
    }
    
    .calendar-day:nth-child(n+5) {
        display: none;
    }
}

@media (max-width: 768px) {
    .calendar-container {
        grid-template-columns: 50px repeat(2, 1fr);
    }
    
    .calendar-day:nth-child(n+4) {
        display: none;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .col-6 {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .calendar-container {
        grid-template-columns: 40px 1fr;
    }
    
    .calendar-day:nth-child(n+3) {
        display: none;
    }
}

/* 动画 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 表单分组样式 */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color-light);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
} 